<template>
  <div class="box">
    <img
      class="zimg"
      src="@/assets/images/celue.png"
      alt=""
    />
    <div class="ulbox" v-if="aiList.length">
      <div class="libox" v-for="item in aiList" :key="item.id">
        <ai-item :detail="item"></ai-item>
      </div>
    </div>
    <van-empty
      v-else
      description="暂无数据"
      image-size="100"
      :image="require('@/assets/images/null.png')"
    />
  </div>
</template>
    
<script setup lang='ts'>
import AiItem from "./AiItem.vue";
import { useStore } from "@/store";
import { ref, onMounted, defineExpose } from "vue";
import http from "@/utils/http";
const store = useStore();

const aiList = ref<any>([]);
// onMounted(()=>{
//   console.log('刷新')
//   getAiList()
// })

const getAiList = () => {
  http
    .get("strategy/app/group/contract/page", {
      current: 1,
      size: 200,
    })
    .then((res: any) => {
      console.log(res);
      if (res.code === 0) {
        aiList.value = res.data.records;
      }
    });
};
defineExpose({
  getAiList,
});
</script>
    
<style lang="scss" scoped>
.box {
  padding: 14px;
  .zimg {
    width: 100%;
    display: block;
    height: 110px;
    border-radius: 2px;
    margin-bottom: 14px;
  }
}
.libox {
  margin-top: 4px;
  // border:1px solid #000;
  // background: url("@/assets/images/biankuang.png") center no-repeat;
  // background-size: 108% 100%;
  // border-radius: 4px;
  overflow: hidden;
}
</style>